﻿@{
    Layout = "";
}
@model Shipping.ByWeight.Models.ShippingByWeightModel
<form id="EditPopup" asp-controller="ShippingByWeight" asp-action="EditPopup" method="post"
      asp-route-ShippingByWeightId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["ShippingByWeightId"])"
      asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
      asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">

    <div class="row">
        <div class="col-md-12">
            <div class="x_panel light form-fit">
                <div class="x_title">
                    <div class="caption">
                        <i class="fa fa-list-alt"></i>
                        @Loc["Admin.Common.Edit"]
                    </div>
                </div>
                <div class="x_content form">
                    <partial name="_CreateOrUpdate" model="Model"/>
                </div>
            </div>
        </div>
    </div>
    <script>
        var mfp = $.magnificPopup.instance;
        $("#EditPopup").submit(function (e) {
            e.preventDefault();
            var form = $(this);
            var url = form.attr('action');
            $.ajax({
                type: "POST",
                url: url,
                data: form.serialize(),
                success: function (data) {
                    mfp.close();
                    $('#btnRefresh').click();
                }
            });
        });
    </script>
</form>